package com.lenovo.leos.letools;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import android.os.Environment;
import android.test.AndroidTestCase;
import android.util.Log;

import com.lenovo.leos.letools.domain.Folder;
import com.lenovo.leos.letools.domain.LoadFile;
import com.lenovo.leos.letools.lenovodata.UploadDirServer;

/**
 * junit test
 * 
 * @author cys
 */
public class TestUploadDirServer extends AndroidTestCase {

	private UploadDirServer uds;
	
	public TestUploadDirServer(){
		uds = new UploadDirServer();
	}

	public void testRecursiveList()throws Exception{
		File sdcardRoot = Environment.getExternalStorageDirectory();
		File[] rootdir = new File[]{sdcardRoot};
		uds.recursiveListDir(this.getContext(),rootdir);
	}
	public void testRecursiveCreateDir()throws Exception{
		File sdcardRoot = Environment.getExternalStorageDirectory();
		File[] parentDir2 = new File[]{new File(sdcardRoot,"parentDir2")};
		uds.recursiveCreateDir(this.getContext(), parentDir2,"1301279145610203981");
	}
	public void testRecursiveCreateDirAndMapingWholePathAndFileInf()throws Exception{
		File sdcardRoot = Environment.getExternalStorageDirectory();
		File[] parentDir2 = new File[]{new File(sdcardRoot,"parentDir2")};
		Map<String,String> maps = new HashMap<String, String>();
		uds.recursiveCreateDirAndMapingWholePathAndFileInf(this.getContext(), parentDir2,"1301279145610203981",maps);
		for(Map.Entry<String,String> entry:maps.entrySet()){
			Log.i("map","=======filepath:"+entry.getKey()+"  "+"parentdirid:"+entry.getValue());
		}
	}
}
